<script setup>

defineProps({
    msg:String
})

const emit = defineEmits(['changeMsg'])

const btnHandler = ()=>{
    emit('changeMsg','dell')
}
</script>

<template>
<div>
    <h1>子组件</h1>
    <p>
        {{ msg }}
    </p>
    <button @click="btnHandler">修改父组件内容</button>
</div>

</template>

<style scoped>

</style>